﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HCQ2_Model;
using System.ComponentModel.DataAnnotations;

namespace HCQ2_Model
{
    public class HeadWordModel
    {
        /// <summary>
        ///  主键
        /// </summary>
        public int pw_id { get; set; }
        /// <summary>
        ///  关卡id
        /// </summary>
        [Required(ErrorMessage ="关卡必填")]
        public int cp_id { get; set; }
        /// <summary>
        ///  关卡名称
        /// </summary>
        public string cp_name { get; set; }
        /// <summary>
        ///  课件id
        /// </summary>
        [Required(ErrorMessage = "课件必填")]
        public int file_id { get; set; }
        /// <summary>
        ///  课件标题
        /// </summary>
        public string file_name { get; set; }
        /// <summary>
        ///  单词
        /// </summary>
        [Required(ErrorMessage = "单词必填")]
        public string word { get; set; }
        /// <summary>
        ///  国际音标
        /// </summary>
        public string gj_symbol { get; set; }
        /// <summary>
        ///  KK音标
        /// </summary>
        public string kk_symbol { get; set; }
        /// <summary>
        ///  词性
        /// </summary>
        public string cp_type { get; set; }
        /// <summary>
        ///  中文解释
        /// </summary>
        public string china_mean { get; set; }
        /// <summary>
        ///  创建人
        /// </summary>
        public string create_name { get; set; }
        /// <summary>
        ///  创建时间
        /// </summary>
        public string create_date { get; set; }
        /// <summary>
        ///  更新人
        /// </summary>
        public string update_name { get; set; }
        /// <summary>
        ///  更新时间
        /// </summary>
        public string update_date { get; set; }
        /// <summary>
        ///  备注
        /// </summary>
        public string cp_note { get; set; }
        public T_VRCustomPassWord ToEntry()
        {
            return new T_VRCustomPassWord
            {
                pw_id = this.pw_id,
                cp_id = this.cp_id,
                cp_name = this.cp_name,
                file_id = this.file_id,
                file_name = this.file_name,
                word = this.word,
                gj_symbol = this.gj_symbol,
                kk_symbol = this.kk_symbol,
                cp_type = this.cp_type,
                china_mean = this.china_mean,
                create_date = DateTime.Now,
                create_name = this.create_name,
                update_date = DateTime.Now,
                update_name = this.update_name,
                cp_note = this.cp_note
            };
        }
    }
    public partial class T_VRCustomPassWord
    {
        public HeadWordModel ToPOCO()
        {
            return new HeadWordModel
            {
                pw_id = this.pw_id,
                cp_id = this.cp_id,
                cp_name = this.cp_name,
                file_id = this.file_id,
                file_name = this.file_name,
                word = this.word,
                gj_symbol = this.gj_symbol,
                kk_symbol = this.kk_symbol,
                cp_type = this.cp_type,
                china_mean = this.china_mean,
                create_date = this.create_date.ToString("yyyy-MM-dd HH:mm"),
                create_name = this.create_name,
                update_date = this.update_date.ToString("yyyy-MM-dd HH:mm"),
                update_name = this.update_name,
                cp_note = this.cp_note
            };
        }
    }
}
